<?php
header("Pragma: public");
header("Expires: 0");
header("Accept-Ranges: bytes");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-word");
header('Content-Disposition: attachment; filename=abiturientsabc.doc');
header("Content-Transfer-Encoding: binary");

foreach ($educationlevels as $eduid => $eduname):
	foreach ($professions as $profid => $profname):
		foreach ($learningforms as $lfid => $lfname):
			foreach ($learningtypes as $ltid => $ltname):
				if (!empty($abiturientslist[$eduid][$profid][$lfid][$ltid])) {
					$fios = $abiturientslist[$eduid][$profid][$lfid][$ltid];
					 sort($fios);
					echo '<h4>';
					echo ' Уровень образования ';
					echo $eduname;
					echo ' Специальность ';
					echo $profname;
					echo ' Форма обучения ';
					echo $lfname;
					echo ' Тип обучения ';
					echo $ltname;
					echo '</h4>';
					echo '<table>';
					foreach ($fios as $fio):
						echo '<tr>';
						echo '<td>';
							echo $fio;
						echo '</td>';
						echo '</tr>';					
					endforeach;
					echo '</table>';
				} else {
					continue;
				}
			endforeach;
		endforeach;
	endforeach;
endforeach;

